<?php
namespace System\core;


class Safety {

    public static function httpSafe(){
        $get = $_GET;
        $post = $_POST;

        foreach ($get as $key => $value) {
            $get[$key] = self::escape($value);
        }
        
        foreach ($post as $key => $value) {
            $post[$key] = self::escape($value);
        }

        $_GET = $get;
        $_POST = $post;
    }
    
    public static function escape($string) {
        return htmlentities($string, ENT_QUOTES, 'UTF-8');
    }

}